<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="fragments :: head(title=~{::title/text()})">
  <title th:text="#{list.title}">Messages : View all</title>
</head>
<body>
<div class="container">
  <div th:replace="fragments :: navbar"></div>
  <div class="float-right mt-2">
    <a class="btn btn-primary btn-sm" href="form.html" th:href="@{/(form)}" th:text="#{list.create}">Create Message</a>
  </div>
  <h4 class="float-left mt-2" th:text="#{list.title}">Messages : View all</h4>
  <table class="table table-bordered table-striped">
    <thead>
    <tr>
      <th th:text="#{list.table.id}">ID</th>
      <th th:text="#{list.table.created}">Created</th>
      <th th:text="#{list.table.summary}">Summary</th>
    </tr>
    </thead>
    <tbody>
    <tr th:if="${messages.empty}">
      <td colspan="3" th:text="#{list.table.empty}">No messages</td>
    </tr>
    <tr th:each="message : ${messages}">
      <td th:text="${message.id}">1</td>
      <td th:text="${#calendars.format(message.created)}">July 11,
                                                          2012 2:17:16 PM CDT
      </td>
      <td><a href="view.html" th:href="@{'/' + ${message.id}}"
             th:text="${message.summary}"> The summary </a></td>
    </tr>
    </tbody>
  </table>
</div>
</body>
</html>
